package com.weaver.openapi.service;

import com.weaver.openapi.pojo.*;
import com.weaver.openapi.util.*;
import java.util.*;
import cn.hutool.http.*;
import com.alibaba.fastjson.*;
import com.weaver.openapi.pojo.attend.params.*;
import com.weaver.openapi.pojo.attend.res.*;

public class AttendService
{
    public static MessageResult checkV2(final AttendCheckVo attendCheckVo, String host, final Map<String, String> headers) {
        host = HostUtil.beforeRequestCheckHeaders(host, headers, "application/json");
        final Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("type", attendCheckVo.getType());
        paramMap.put("longitude", attendCheckVo.getLongitude());
        paramMap.put("latitude", attendCheckVo.getLatitude());
        paramMap.put("checkAddress", attendCheckVo.getCheckAddress());
        paramMap.put("wifiId", attendCheckVo.getWifiId());
        paramMap.put("wifiName", attendCheckVo.getWifiName());
        final String resJson = ((HttpRequest)HttpRequest.post(host + String.format("/attend/v2/check?access_token=%s&userid=%s", attendCheckVo.getAccessToken(), attendCheckVo.getUserid())).body(JSONObject.toJSONString((Object)paramMap)).headerMap((Map)headers, true)).execute().body();
        return (MessageResult)JSONObject.parseObject(resJson, (Class)MessageResult.class);
    }
    
    public static AttendResult getAbsenteeismV2(final AttendVo attendVo, String host, final Map<String, String> headers) {
        host = HostUtil.beforeRequestCheckHeaders(host, headers, "application/x-www-form-urlencoded");
        final Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("access_token", attendVo.getAccessToken());
        paramMap.put("userIds", attendVo.getUserIds());
        paramMap.put("startDate", attendVo.getStartDate());
        paramMap.put("endDate", attendVo.getEndDate());
        paramMap.put("onlyNormal", attendVo.getOnlyNormal());
        final String resJson = ((HttpRequest)HttpRequest.post(host + "/attend/v2/getAbsenteeism").form((Map)paramMap).headerMap((Map)headers, true)).execute().body();
        return (AttendResult)JSONObject.parseObject(resJson, (Class)AttendResult.class);
    }
    
    public static AttendResult getAbsenceV2(final AttendVo attendVo, String host, final Map<String, String> headers) {
        host = HostUtil.beforeRequestCheckHeaders(host, headers, "application/x-www-form-urlencoded");
        final Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("access_token", attendVo.getAccessToken());
        paramMap.put("userIds", attendVo.getUserIds());
        paramMap.put("startDate", attendVo.getStartDate());
        paramMap.put("endDate", attendVo.getEndDate());
        final String resJson = ((HttpRequest)HttpRequest.post(host + "/attend/v2/getAbsence").form((Map)paramMap).headerMap((Map)headers, true)).execute().body();
        return (AttendResult)JSONObject.parseObject(resJson, (Class)AttendResult.class);
    }
    
    public static AttendResult getHolidayV2(final AttendVo attendVo, String host, final Map<String, String> headers) {
        host = HostUtil.beforeRequestCheckHeaders(host, headers, "application/x-www-form-urlencoded");
        final Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("access_token", attendVo.getAccessToken());
        paramMap.put("userIds", attendVo.getUserIds());
        paramMap.put("startDate", attendVo.getStartDate());
        paramMap.put("endDate", attendVo.getEndDate());
        final String resJson = ((HttpRequest)HttpRequest.post(host + "/attend/v2/getHoliday").form((Map)paramMap).headerMap((Map)headers, true)).execute().body();
        return (AttendResult)JSONObject.parseObject(resJson, (Class)AttendResult.class);
    }
    
    public static AttendResult getUncheckedV2(final AttendVo attendVo, String host, final Map<String, String> headers) {
        host = HostUtil.beforeRequestCheckHeaders(host, headers, "application/x-www-form-urlencoded");
        final Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("access_token", attendVo.getAccessToken());
        paramMap.put("userIds", attendVo.getUserIds());
        paramMap.put("startDate", attendVo.getStartDate());
        paramMap.put("endDate", attendVo.getEndDate());
        paramMap.put("onlyNormal", attendVo.getOnlyNormal());
        final String resJson = ((HttpRequest)HttpRequest.post(host + "/attend/v2/getUnchecked").form((Map)paramMap).headerMap((Map)headers, true)).execute().body();
        return (AttendResult)JSONObject.parseObject(resJson, (Class)AttendResult.class);
    }
    
    public static AttendResult getLateV2(final AttendVo attendVo, String host, final Map<String, String> headers) {
        host = HostUtil.beforeRequestCheckHeaders(host, headers, "application/x-www-form-urlencoded");
        final Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("access_token", attendVo.getAccessToken());
        paramMap.put("userIds", attendVo.getUserIds());
        paramMap.put("startDate", attendVo.getStartDate());
        paramMap.put("endDate", attendVo.getEndDate());
        paramMap.put("onlyNormal", attendVo.getOnlyNormal());
        final String resJson = ((HttpRequest)HttpRequest.post(host + "/attend/v2/getLate").form((Map)paramMap).headerMap((Map)headers, true)).execute().body();
        return (AttendResult)JSONObject.parseObject(resJson, (Class)AttendResult.class);
    }
    
    public static AttendResult getEarlyOutV2(final AttendVo attendVo, String host, final Map<String, String> headers) {
        host = HostUtil.beforeRequestCheckHeaders(host, headers, "application/x-www-form-urlencoded");
        final Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("access_token", attendVo.getAccessToken());
        paramMap.put("userIds", attendVo.getUserIds());
        paramMap.put("startDate", attendVo.getStartDate());
        paramMap.put("endDate", attendVo.getEndDate());
        paramMap.put("onlyNormal", attendVo.getOnlyNormal());
        final String resJson = ((HttpRequest)HttpRequest.post(host + "/attend/v2/getEarlyOut").form((Map)paramMap).headerMap((Map)headers, true)).execute().body();
        return (AttendResult)JSONObject.parseObject(resJson, (Class)AttendResult.class);
    }
    
    public static AttendResult getAppealsV2(final AttendVo attendVo, String host, final Map<String, String> headers) {
        host = HostUtil.beforeRequestCheckHeaders(host, headers, "application/x-www-form-urlencoded");
        final Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("access_token", attendVo.getAccessToken());
        paramMap.put("userIds", attendVo.getUserIds());
        paramMap.put("startDate", attendVo.getStartDate());
        paramMap.put("endDate", attendVo.getEndDate());
        final String resJson = ((HttpRequest)HttpRequest.post(host + "/attend/v2/getAppeals").form((Map)paramMap).headerMap((Map)headers, true)).execute().body();
        return (AttendResult)JSONObject.parseObject(resJson, (Class)AttendResult.class);
    }
    
    public static AttendResult getWorkDayV2(final AttendVo attendVo, String host, final Map<String, String> headers) {
        host = HostUtil.beforeRequestCheckHeaders(host, headers, "application/x-www-form-urlencoded");
        final Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("access_token", attendVo.getAccessToken());
        paramMap.put("userIds", attendVo.getUserIds());
        paramMap.put("startDate", attendVo.getStartDate());
        paramMap.put("endDate", attendVo.getEndDate());
        final String resJson = ((HttpRequest)HttpRequest.post(host + "/attend/v2/getWorkDay").form((Map)paramMap).headerMap((Map)headers, true)).execute().body();
        return (AttendResult)JSONObject.parseObject(resJson, (Class)AttendResult.class);
    }
    
    public static AttendResult getHolidayWorkV2(final AttendVo attendVo, String host, final Map<String, String> headers) {
        host = HostUtil.beforeRequestCheckHeaders(host, headers, "application/x-www-form-urlencoded");
        final Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("access_token", attendVo.getAccessToken());
        paramMap.put("userIds", attendVo.getUserIds());
        paramMap.put("startDate", attendVo.getStartDate());
        paramMap.put("endDate", attendVo.getEndDate());
        final String resJson = ((HttpRequest)HttpRequest.post(host + "/attend/v2/getHolidayWork").form((Map)paramMap).headerMap((Map)headers, true)).execute().body();
        return (AttendResult)JSONObject.parseObject(resJson, (Class)AttendResult.class);
    }
    
    public static AttendResult getPlayWorkV2(final AttendVo attendVo, String host, final Map<String, String> headers) {
        host = HostUtil.beforeRequestCheckHeaders(host, headers, "application/x-www-form-urlencoded");
        final Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("access_token", attendVo.getAccessToken());
        paramMap.put("userIds", attendVo.getUserIds());
        paramMap.put("startDate", attendVo.getStartDate());
        paramMap.put("endDate", attendVo.getEndDate());
        final String resJson = ((HttpRequest)HttpRequest.post(host + "/attend/v2/getPlayWork").form((Map)paramMap).headerMap((Map)headers, true)).execute().body();
        return (AttendResult)JSONObject.parseObject(resJson, (Class)AttendResult.class);
    }
    
    public static AttendResult getLeaveV2(final AttendVo attendVo, String host, final Map<String, String> headers) {
        host = HostUtil.beforeRequestCheckHeaders(host, headers, "application/x-www-form-urlencoded");
        final Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("access_token", attendVo.getAccessToken());
        paramMap.put("userIds", attendVo.getUserIds());
        paramMap.put("startDate", attendVo.getStartDate());
        paramMap.put("endDate", attendVo.getEndDate());
        final String resJson = ((HttpRequest)HttpRequest.post(host + "/attend/v2/getLeave").form((Map)paramMap).headerMap((Map)headers, true)).execute().body();
        return (AttendResult)JSONObject.parseObject(resJson, (Class)AttendResult.class);
    }
    
    public static AttendResult getBusinessTripV2(final AttendVo attendVo, String host, final Map<String, String> headers) {
        host = HostUtil.beforeRequestCheckHeaders(host, headers, "application/x-www-form-urlencoded");
        final Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("access_token", attendVo.getAccessToken());
        paramMap.put("userIds", attendVo.getUserIds());
        paramMap.put("startDate", attendVo.getStartDate());
        paramMap.put("endDate", attendVo.getEndDate());
        final String resJson = ((HttpRequest)HttpRequest.post(host + "/attend/v2/getBusinessTrip").form((Map)paramMap).headerMap((Map)headers, true)).execute().body();
        return (AttendResult)JSONObject.parseObject(resJson, (Class)AttendResult.class);
    }
    
    public static AttendResult getOutV2(final AttendVo attendVo, String host, final Map<String, String> headers) {
        host = HostUtil.beforeRequestCheckHeaders(host, headers, "application/x-www-form-urlencoded");
        final Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("access_token", attendVo.getAccessToken());
        paramMap.put("userIds", attendVo.getUserIds());
        paramMap.put("startDate", attendVo.getStartDate());
        paramMap.put("endDate", attendVo.getEndDate());
        final String resJson = ((HttpRequest)HttpRequest.post(host + "/attend/v2/getOut").form((Map)paramMap).headerMap((Map)headers, true)).execute().body();
        return (AttendResult)JSONObject.parseObject(resJson, (Class)AttendResult.class);
    }
    
    public static AttendResult getCollectV2(final AttendVo attendVo, String host, final Map<String, String> headers) {
        host = HostUtil.beforeRequestCheckHeaders(host, headers, "application/x-www-form-urlencoded");
        final Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("access_token", attendVo.getAccessToken());
        paramMap.put("userIds", attendVo.getUserIds());
        paramMap.put("startDate", attendVo.getStartDate());
        paramMap.put("endDate", attendVo.getEndDate());
        final String resJson = ((HttpRequest)HttpRequest.post(host + "/attend/v2/getCollect").form((Map)paramMap).headerMap((Map)headers, true)).execute().body();
        return (AttendResult)JSONObject.parseObject(resJson, (Class)AttendResult.class);
    }
    
    public static AttendResult getOverTimeV2(final AttendVo attendVo, String host, final Map<String, String> headers) {
        host = HostUtil.beforeRequestCheckHeaders(host, headers, "application/x-www-form-urlencoded");
        final Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("access_token", attendVo.getAccessToken());
        paramMap.put("userIds", attendVo.getUserIds());
        paramMap.put("startDate", attendVo.getStartDate());
        paramMap.put("endDate", attendVo.getEndDate());
        final String resJson = ((HttpRequest)HttpRequest.post(host + "/attend/v2/getOverTime").form((Map)paramMap).headerMap((Map)headers, true)).execute().body();
        return (AttendResult)JSONObject.parseObject(resJson, (Class)AttendResult.class);
    }
}
